#include #include #include using namespace std; double typ_apokl(double,double,double,double,double); double mo(double,double,double,double); int main() { double s1,s2,s3,s4,a; do{ cout<<"grapse tis 4 bathmologies h dwse enan arnhtiko gia termatismo"<>s1; if (s1>=0)//an dwsei arnhtiko prospernaei oti yparxeisthn if kai termatizetai kai h while// { cin>>s2>>s3>>s4; a=mo(s1,s2,s3,s4); cout<<"h typikh apoklish twn 4 ari8mwn einai "<=0); system ("PAUSE"); return 0; } double typ_apokl(double s1, double s2, double s3, double s4,double a) { return sqrt(pow(s1-a,2)+pow(s2-a,2)+pow(s3-a,2)+pow(s4-a,2)); } double mo(double s1, double s2, double s3, double s4) { if (s1+s2+s3+s4!=0) return (s1+s2+s3+s4)/4; if (s1+s2+s3+s4==0) return 0; }